import Cookies from 'js-cookie'
import settings from '@/settings'

const TokenKey = settings.tokenName

// 从cookie中获取token
export function getToken() {
  return Cookies.get(TokenKey)
}

// 将token设置到cookie中
export function setToken(token) {
  return Cookies.set(TokenKey, token, { expires: 7, path: '/' })
}

// 从cookie中移除token
export function removeToken() {
  return Cookies.remove(TokenKey)
}
